import {post} from "@/utils/http.js";
import {rsaPubEncrypt} from "@/utils/EncryptUtils.js";
import useAccountStore from "@/store/modules/AccountStore.js";
import {elMessageTip} from "@/utils/MessageTipUtils.js";
import {resolvePromise_status} from "@/utils/ReturnUtils.js";

export const logoutAPI = () => {
    return post(
        '/logout',
        {
            account: rsaPubEncrypt(useAccountStore().account),
        }
    ).then(
        res => {
            elMessageTip(res)
            return resolvePromise_status(res)
        }
    )
}